import { createApp } from "vue";
import { createPinia } from "pinia";
import VueLazyload from "vue-lazyload";
import App from "./App.vue";
import router from "./router";
import "normalize.css";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";

import { Button } from "vant";
import { Tabbar, TabbarItem } from "vant";
import { Grid, GridItem } from "vant";
import { Tab, Tabs } from "vant";
import { Dialog } from "vant";
import { Search } from "vant";
import { Swipe, SwipeItem } from "vant";
import { NavBar } from "vant";
import { Card } from "vant";
import { List } from "vant";
import { Pagination } from "vant";
import { Image as VanImage } from "vant";
import { Sidebar, SidebarItem } from "vant";
import { Popup } from "vant";
import { Cell } from "vant";
import { Icon } from "vant";
import { Sticky } from "vant";
import { DropdownMenu, DropdownItem } from "vant";
import { Empty } from "vant";
import { ActionBar, ActionBarIcon, ActionBarButton } from "vant";
import { Form, Field, CellGroup } from "vant";
import { Tag } from "vant";
import { ShareSheet } from "vant";
import { SubmitBar } from "vant";
import { Checkbox, CheckboxGroup } from "vant";

const app = createApp(App);
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
app.use(pinia);
app.use(router);
app.use(VueLazyload, {
  preLoad: 1.3,
  error: "../static/goods_default.jpg",
  loading: "../static/weixin.gif",
  attempt: 1,
});

app.use(Button);
app.use(Tabbar);
app.use(TabbarItem);
app.use(Grid);
app.use(GridItem);
app.use(Tab);
app.use(Tabs);
app.use(Dialog);
app.use(Search);
app.use(Swipe);
app.use(SwipeItem);
app.use(NavBar);
app.use(VanImage);
app.use(Card);
app.use(List);
app.use(Pagination);
app.use(Sidebar);
app.use(SidebarItem);
app.use(Popup);
app.use(Cell);
app.use(Icon);
app.use(Sticky);
app.use(DropdownMenu);
app.use(DropdownItem);
app.use(Empty);
app.use(ActionBar);
app.use(ActionBarIcon);
app.use(ActionBarButton);
app.use(Form);
app.use(Field);
app.use(CellGroup);
app.use(Tag);
app.use(ShareSheet);
app.use(SubmitBar);
app.use(Checkbox);
app.use(CheckboxGroup);

app.mount("#app");
